package com.sskj.gocoin.p.activity;

import com.lzy.okgo.OkGo;
import com.lzy.okgo.model.Response;
import com.sskj.gocoin.MyAppLication;
import com.sskj.gocoin.m.HttpConfig;
import com.sskj.gocoin.m.bean.HttpData;
import com.sskj.gocoin.m.http.JsonCallBack;
import com.sskj.gocoin.p.base.BasePresenter;
import com.sskj.gocoin.utils.ToastUtil;
import com.sskj.gocoin.v.activity.FundTransferActivity;

/**
 * ProjectName：new_bfex
 * DESC: (类描述)
 * Created by 李岩 on 2018/7/12 0012
 * updateName:(修改人名称)
 * updateTime:(修改时间)
 * updateDesc:(修改内容)
 */
public class FundInputPresenter extends BasePresenter<FundTransferActivity>{
    public void reuqestSubmitTransfer(String inputValue, int type) {
        OkGo.<HttpData>post(HttpConfig.BASE_URL + HttpConfig.FUND_TRANSFER)
                .params("account", MyAppLication.getAccount())
                .params("type", type)
                .params("num", inputValue)
                .execute(new JsonCallBack<HttpData>(this) {
                    @Override
                    protected void _onSuccess(Response<HttpData> response) {
                        ToastUtil.getInstance(MyAppLication.getApplication()).showMessage(response.body().getMsg());
                        mView.onTransferSubmitSuccess(type, Double.valueOf(inputValue));
                    }
                });
    }
}
